{% do script(['app/js/upload-qrcode-image/index.js']) %}

<div class="cd-image-upload">
  <img class="{{ imageClass }} js-qrcode-upload-cover" id="{{ targetImg }}" src="{{ imageSrc }}">
  <div class="image-upload-mask">
    <div class="image-upload-content">
      <i class="cd-icon cd-icon-camera"></i>
      {{ imageText }}
    </div>
  </div>
  <label class="image-upload-label">
    <input type="file" name="qrcode" class="js-qrcode-upload-input hidden"
    accept="{% if app.request.headers.get('User-Agent') matches '/MicroMessenger/' %}image/*{% else %}image/bmp,image/jpeg,image/png,image/jpg{% endif %}"
    data-token="{{ upload_token( uploadToken|default('user'), 'image') }}"
    data-file-upload="{{path('qr_code_upload')}}"
    data-crop="{{ path('file_img_crop') }}"
    data-save-url="{{ saveUrl }}"
    data-target-img="#{{ targetImg }}"
    data-crop-width="{{ cropWidth }}"
    data-crop-height="{{ cropHeight }}" />
  </label>
</div>